<template>
  <div class="right-card-1">
    <HeaderTitle :imgUrl="`output-img`" />
    <div class="right-card-1-conter" id="right-card-1-conter"></div>
  </div>
</template>

<script setup>
import * as echarts from 'echarts';
const option = {
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    itemWidth: 20, // 设置图例项的宽度
    itemHeight: 5, // 设置图例
    icon: 'rect',
    data: [{ name: '资源量' }, { name: '储量' }]
  },
  grid: {
    top: '15%',
    left: '0%',
    right: '6%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data: ['2018年', '2019年', '2020年', '2021年', '2022年']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      name: '资源量',
      type: 'line',
      stack: 'Total',
      smooth: true,
      data: [120, 132, 101, 134, 90]
    },
    {
      name: '储量',
      type: 'line',
      stack: 'Total',
      smooth: true,
      data: [820, 932, 901, 934, 1290]
    }
  ]
};
onMounted(() => {
  const myChart = echarts.init(document.getElementById('right-card-1-conter'), null, {
    renderer: 'canvas',
    useDirtyRect: false
  });
  myChart.setOption(option);
});
</script>
